Skip to content

Support updating worklist item status via relay connection - #110

Merged
steventux merged 6 commits into
mainfrom
DTOSS-12874-enable-update-worklist-item-status-via-relay
May 12, 2026
Merged

Support updating worklist item status via relay connection#110
steventux merged 6 commits into
mainfrom
DTOSS-12874-enable-update-worklist-item-status-via-relay

Conversation

@steventux

Copy link
Copy Markdown
Contributor

Description

There's a good chance MPPS will not be used by modalities to progress the state of the worklist item.
We can make this update from Manage as the appointment steps are completed or cancelled.

This PR adds support for making status updates to worklist items over the relay connection.

Jira link

https://nhsd-jira.digital.nhs.uk/browse/DTOSS-12874

Review notes

Review checklist

  • Check database queries are correctly scoped to current_provider

@steventux
steventux force-pushed the DTOSS-12874-enable-update-worklist-item-status-via-relay branch from 2aa96ab to 4751951 Compare May 11, 2026 16:04
@steventux
steventux force-pushed the DTOSS-12874-enable-update-worklist-item-status-via-relay branch from 4751951 to 0d6706a Compare May 11, 2026 16:06
@steventux
steventux requested a review from carlosmartinez May 12, 2026 07:31
if updated_item is None:
return {"status": "error", "message": f"Worklist item '{accession_number}' not found"}

return {"accession_number": accession_number, "status": "confirmed"}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given CreateWorklistItem returns status "created", maybe this should return status "updated"?

@steventux steventux May 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the statuses we handle for a relay conversation https://github.com/NHSDigital/dtos-manage-breast-screening/blob/main/manage_breast_screening/gateway/models.py#L9-L14
They end up being persisted on the GatewayAction in Manage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm sorry that's not entirely correct.
There's a bit of Manage which looks for created or confirmed statuses coming back in Relay responses, and created is not a valid GatewayActionStatus value nor is exists which may also be returned but is never used.
updated seems like the best option given we use created and exists already.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/services/mwl/__init__.py Outdated
current_status = MWLStatus(status)
previous_status = MWLStatusManager._TRANSITIONS[current_status]
return previous_status, current_status
except KeyError:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might there also be a ValueError?

@carlosmartinez carlosmartinez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

steventux added 2 commits May 12, 2026 13:24
We don't want to replay the status we've set on the worklist item, use a CRUD verb.
@steventux
steventux force-pushed the DTOSS-12874-enable-update-worklist-item-status-via-relay branch from a9e82b7 to 9904e65 Compare May 12, 2026 12:24
@steventux
steventux merged commit c48c213 into main May 12, 2026
9 checks passed
@steventux
steventux deleted the DTOSS-12874-enable-update-worklist-item-status-via-relay branch May 12, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants